/*
 * @Author: Logs404
 * @LastEditors: Logs404
 * 可以输入预定的版权声明、个性签名、空行等
 */
var http = require('http');
var url = require('url');
var util = require('util');

function init(router) {
    function event(request, response) {
        response.writeHead(200, { 'Content-Type': 'application/json' })
        let params = url.parse(request.url,true).query
        router(params)
        console.log(params)
        response.end(util.inspect(params))
    }
    http.createServer(event).listen(2333)
}

exports.init = init